{include file="public/header" /}





<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$Think.lang.ds_order}</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
    <form method="get">
        <div class="ds-search-form">
            <dl>
                <dt>{$Think.lang.ds_order_sn}</dt>
                <dd><input type="text" class="text w150" name="order_sn" value="{$Request.param.order_sn}"></dd>
            </dl>
            <dl>
                <dt>订单类型</dt>
                <dd>
                    <select name="order_type" class="querySelect">
                        <option value="">{$Think.lang.ds_please_choose}</option>
                        <option value="1" {if condition="$Request.param.order_type eq '1'"}selected{/if}>销售订单</option>
                        <option value="2" {if condition="$Request.param.order_type eq '2'"}selected{/if}>项目定制订单</option>
                        <option value="3" {if condition="$Request.param.order_type eq '3'"}selected{/if}>服务配件订单</option>
                    </select>
                </dd>
            </dl>
            <dl>
                <dt>{$Think.lang.order_state}</dt>
                <dd>
                    <select name="order_state" class="querySelect">
                        <option value="">{$Think.lang.ds_please_choose}</option>
                        <option value="0" {if condition="$Request.param.order_state eq '0'"}selected{/if}>待付款</option>
                        <option value="1" {if condition="$Request.param.order_state eq '1'"}selected{/if}>待收货</option>
                        <option value="2" {if condition="$Request.param.order_state eq '2'"}selected{/if}>已完成</option>
                        <option value="3" {if condition="$Request.param.order_state eq '3'"}selected{/if}>已取消</option>
                        <option value="4" {if condition="$Request.param.order_state eq '4'"}selected{/if}>待退款</option>
                    </select>
                </dd>
            </dl>
            <dl>
                <dt>作废订单</dt>
                <dd>
                    <select name="is_cancel" class="querySelect">
                        <option value="">{$Think.lang.ds_please_choose}</option>
                        <option value="0" {if condition="$Request.param.is_cancel eq '0'"}selected{/if}>正常</option>
                        <option value="1" {if condition="$Request.param.is_cancel eq '1'"}selected{/if}>已作废</option>
                    </select>
                </dd>
            </dl>
            <dl>
                <dt>{$Think.lang.order_time_from}</dt>
                <dd>
                    <input type="text" class="txt date" name="query_start_time" id="query_start_time" value="{$Request.param.query_start_time}">
                        &nbsp;–&nbsp;
                        <input id="query_end_time" class="txt date" type="text" name="query_end_time" value="{$Request.param.query_end_time}">
                </dd>
            </dl>
            <dl>
                <dt>{$Think.lang.ds_buyer_name}</dt>
                <dd>
                    <input type="text" class="text w80" name="buyer_name" value="{$Request.param.buyer_name}">
                </dd>
            </dl>
            <div class="btn_group">
                <input type="submit" class="btn" value="{$Think.lang.ds_search}" style="display: inline-block;">
                {if $filtered}
                <a href="{:url('Order/index')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
                {/if}
            </div>
        </div>    
    </form>

    <table class="ds-default-table">
        <thead>
            <tr>
                <th>{$Think.lang.ds_order_sn}</th>
                <th>订单类型</th>
                <th>{$Think.lang.ds_buyer_name}</th>
                <th>{$Think.lang.order_time}</th>
                <th>{$Think.lang.order_total_price}</th>
                <th>{$Think.lang.order_state}</th>
                <th>{$Think.lang.ds_handle}</th>
            </tr>
        </thead>
        {empty  name="order_list"}
        <tbody>
            <tr class="no_data">
                <td colspan="20">{$Think.lang.no_record}</td>
            </tr>
        </tbody>
        {else /}
        <tbody>
            {foreach name="order_list" item="order"}
            <tr>
                <td>{$order.order_sn}</td>
                <td>{$app_order_type[$order['app_order_type']]}</td>
                <td>{$order.member_name}</td>
                <td>{$order.create_time|date="Y-m-d H:i:s",###}</td>
                <td>
                {if condition="($order.app_order_type==1)"}
                    {$order.price}
                {elseif condition="($order.app_order_type==2)"}
                    {$order.project_price}
                {elseif condition="($order.app_order_type==3)"}
                    {$order.price}
                {/if}
            </td>
                <td>
                {if condition="($order.app_order_type==1)"}
                    {$order_status[$order['order_status']]}
                {elseif condition="($order.app_order_type==2)"}
                    {if condition="($order.project_order_status==40)"}已完成
                    {elseif condition="($order.project_order_status!=40)"}
                    {$project_order_status[$order['zhu_order_state']]}
                    {/if}
                {elseif condition="($order.app_order_type==3)"}
                    {$service_order_status[$order['order_status']]}
                {/if}
                </td>
                <td>
                    <a href="javascript:dsLayerOpen('{:url('Order/order_list',['order_id'=>$order.app_order_id])}','{$Think.lang.ds_view}{$Think.lang.ds_order}-{$order.order_sn}')" class="dsui-btn-view"><i class="iconfont"></i>{$Think.lang.ds_view}</a>
                    <?php if($order['order_status']!=2&&$order['is_cancel']!=1){ ?>
                    <a href="javascript:dsLayerConfirm('{:url('Order/del_order',['order_id'=>$order.app_order_id])}','您确定要作废该订单吗？')" class="dsui-btn-del"><i class="iconfont"></i>作废订单</a>
                    <?php }?>
                    <?php if($order['audit_refund']==1){ ?>
                    <a href="javascript:dsLayerConfirm('{:url('Order/refund_order',['order_id'=>$order.app_order_id])}','您确定要退款该订单吗？')" class="dsui-btn-edit"><i class="iconfont"></i>退款</a>
                     <?php } ?>
                 
                </td>
            </tr>
            {/foreach}
        </tbody>
        {/empty}
    </table>
    {$show_page}
</div>

<script type="text/javascript">
$(function(){
    $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
    $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
});
</script> 

